package com.benny_driving_dri.act.dialog;

import java.util.List;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.benny_driving_dri.R;
import com.benny_driving_dri.entity.TopUpRec;

public class ReChargeRecDialog extends Dialog {
	private List<TopUpRec> list = null;
	private Context context = null;
	private int position;

	private TextView name, formID, reChargeMoney, reChargeTime, reChargeState,
			back;

	public ReChargeRecDialog(Context context, List<TopUpRec> list, int position) {
		super(context);
		this.context = context;
		this.list = list;
		this.position = position;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.dialog_rechargerec2);
		initView();
	}

	private void initView() {
		name = (TextView) findViewById(R.id.ReChargeDog_tv_DriName);
		formID = (TextView) findViewById(R.id.ReChargeDog_tv_FormID);
		reChargeMoney = (TextView) findViewById(R.id.ReChargeDog_tv_ReChargeMoney);
		reChargeTime = (TextView) findViewById(R.id.ReChargeDog_tv_ReChargeTime);
		reChargeState = (TextView) findViewById(R.id.ReChargeDog_tv_ReChargeState);
		back = (TextView) findViewById(R.id.ReChargeDog_tv_Back);

		name.setText(list.get(position).getName());
		formID.setText(list.get(position).getId());
		reChargeMoney.setText(list.get(position).getCost());
		reChargeTime.setText(list.get(position).getAtime());
		reChargeState.setText(list.get(position).getState());
		back.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				ReChargeRecDialog.this.dismiss();
			}
		});
	}
}
